package com.briup.estore.mapper;

import java.math.BigInteger;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;

import com.briup.estore.bean.Customer;

@Mapper
public interface ICustomerMapper {

	@Select("select id,name,password pwd,zipcode,telephone,email from es_customer where name=#{name} ")
	public Customer findCustomerByName(Customer customer);

	@Insert("insert into es_customer(id,name,password,zipcode,telephone,email)"
			+ " values(#{id},#{name},#{pwd},#{zipcode},#{telephone},#{email}) ")
	@SelectKey(statement = "select my_seq.nextval from dual ", keyProperty = "id", resultType = BigInteger.class, before = true)
	public int insertCustomer(Customer customer);
}
